package com.zdemo.factors;

import java.math.BigInteger;
import java.util.concurrent.atomic.AtomicReference;

public class UnsafeFactorHandler {

	private BigInteger lastNumber;
	private BigInteger[] lastFactors;
	
	public BigInteger[] handle(BigInteger number) {
		if(lastNumber == null || !(lastNumber.intValue() == number.intValue())) {
			lastFactors = factor(number);
		}
		return lastFactors;
	}
	
	BigInteger[] factor(BigInteger i) {
        return new BigInteger[]{i};
    }
}
